<?php
class staticpages_add extends SClass {

    public function process() {
    	try {
    		if ($this->getControlValue('add')) {
    			ServiceUtils::GetFactory()->getStaticpageService()->addStaticpage(
    				$this->getControlValue('title'),
    				$this->getControlValue('content'),
    				$this->getControlValue('url')
    			);
    			$this->assign('message', 'ok');
    		}
    	} catch (ServiceUtils_Exception $exception) {
    		$this->assign('errors', $exception->getErrors());
    	}
    }

}